{extend name="public/base" /}

{block name="style"}
<style>
    .user-avatar {
        width: 4rem;
        height: 4rem;
        object-fit: cover;
    }
</style>
{/block}

{block name="content"}
<div class="container-fluid">
    <div class="breadcrumb-wrapper row">
        <div class="col-12 col-lg-3 col-md-6">
            <h4 class="page-title">会员列表</h4>
        </div>
        <div class="col-12 col-lg-9 col-md-6">
            <ol class="breadcrumb float-right">
                <li><a href="{:url('Manage/home')}">控制台</a></li>
                <li class="active"> / 会员列表</li>
            </ol>
        </div>
    </div>
</div>

<div class="container-fluid">
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-striped table-bordered table-hover">
                            <thead>
                            <tr>
                                <th>ID</th>
                                <th>用户名</th>
                                <th>邮箱</th>
                                <th>手机号</th>
                                <th>头像</th>
                                <th>状态</th>
                                <th>注册时间</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            {volist name="datas" id="item"}
                            <tr>
                                <td>{$item.id}</td>
                                <td>{$item.username}</td>
                                <td>{$item.email}</td>
                                <td>{$item.mobile}</td>
                                <td>
                                    <a href="/uploads/avatar/{$item.avatar}" target="_blank"><img src="/uploads/avatar/{$item.avatar}" class="user-avatar" alt=""></a>
                                </td>
                                <td>
                                    {eq name="item.status" value="1"}
                                    正常
                                    {else/}
                                    隐藏
                                    {/eq}
                                </td>
                                <td>{$item.create_time}</td>
                                <td>
                                    <a href="{:url('User/editUser',['id'=>$item.id])}" class="btn btn-info btn-sm">编辑</a>
                                    <a href="{:url('User/delUser',['id'=>$item.id])}" class="btn btn-danger btn-sm" onclick="return confirm('确定删除此项?')">删除</a>
                                </td>
                            </tr>
                            {/volist}
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<div class="text-center">
    {$datas|raw}
</div>

{/block}